start = 0
end = 0
sum_num = nums[start] + nums[end]
result = 0

while end < len(nums):
    if sum_num >= s:
        start = start + 1
        if end <= start:
            print(result)
            sys.exit(0)
        sum_num = sum(nums[start:end + 1])
        result = end - start + 1
    else:
        end = end + 1
        sum_num = sum(nums[start:end + 1])

print(result)
